package com.ruiysoft.service.mdse.consts;

public class MdseEnum {
	
	// 商品上下架
	public enum MdseStatus {
		UP(1, "上架"), DOWN(2, "下架");

		private int index;
		private String name;

		private MdseStatus(int index, String name) {
			this.index = index;
			this.name = name;
		}

		public static String getName(int index) {
			for (MdseStatus s : MdseStatus.values()) {
				if (s.getIndex() == index) {
					return s.getName();
				}
			}
			return null;
		}

		public int getIndex() {
			return this.index;
		}

		public String getName() {
			return this.name;
		}
	}
	// 商品上下架
		public enum CanUpStatus {
			yes(0, "可上架"), no(1, "不可上架");

			private int index;
			private String name;

			private CanUpStatus(int index, String name) {
				this.index = index;
				this.name = name;
			}

			public static String getName(int index) {
				for (CanUpStatus s : CanUpStatus.values()) {
					if (s.getIndex() == index) {
						return s.getName();
					}
				}
				return null;
			}

			public int getIndex() {
				return this.index;
			}

			public String getName() {
				return this.name;
			}
		}
	// 商品审核状态
		public enum MdseAuditType {
			UP(1, "上架申请"), DOWN(2, "下架申请");

			private int index;
			private String name;

			private MdseAuditType(int index, String name) {
				this.index = index;
				this.name = name;
			}

			public static String getName(int index) {
				for (MdseAuditType s : MdseAuditType.values()) {
					if (s.getIndex() == index) {
						return s.getName();
					}
				}
				return null;
			}

			public int getIndex() {
				return this.index;
			}

			public String getName() {
				return this.name;
			}
		}

	//spuPictype 图片用处
	public enum SpuPicType {
		NORMAL(1, "普通使用"), GRAPHICDETAILS(2, "图文详情");

		private int index;
		private String name;

		private SpuPicType(int index, String name) {
			this.index = index;
			this.name = name;
		}

		public static String getName(int index) {
			for (SpuPicType s : SpuPicType.values()) {
				if (s.getIndex() == index) {
					return s.getName();
				}
			}
			return null;
		}

		public int getIndex() {
			return this.index;
		}

		public String getName() {
			return this.name;
		}
	}
	
		// 商品类型
			public enum MdseType {
				normal(1, "普通商品"), RECHARGE(2, "充值类"), CODE(3, "电子码"), book(4, "图书"), vedio(5, "音像");

				private int index;
				private String name;

				private MdseType(int index, String name) {
					this.index = index;
					this.name = name;
				}

				public static String getName(int index) {
					for (MdseType s : MdseType.values()) {
						if (s.getIndex() == index) {
							return s.getName();
						}
					}
					return null;
				}
				public static MdseType getEnum(int index) {
					for (MdseType s : MdseType.values()) {
						if (s.getIndex() == index) {
							return s;
						}
					}
					return null;
				}
				public int getIndex() {
					return this.index;
				}

				public String getName() {
					return this.name;
				}
			}
			public enum AutoGrantEnum {
				NO(0, "否不是自动发放"), YES(1, "是自动发放");

				private int index;
				private String name;

				private AutoGrantEnum(int index, String name) {
					this.index = index;
					this.name = name;
				}

				public static String getName(int index) {
					for (AutoGrantEnum s : AutoGrantEnum.values()) {
						if (s.getIndex() == index) {
							return s.getName();
						}
					}
					return null;
				}

				public int getIndex() {
					return this.index;
				}

				public String getName() {
					return this.name;
				}
			}
			
			public enum IsUseEnum {
				NO(0, "未使用"), YES(1, "已使用");

				private int index;
				private String name;

				private IsUseEnum(int index, String name) {
					this.index = index;
					this.name = name;
				}

				public static String getName(int index) {
					for (IsUseEnum s : IsUseEnum.values()) {
						if (s.getIndex() == index) {
							return s.getName();
						}
					}
					return null;
				}
				public static IsUseEnum getIndex(String name) {
					for (IsUseEnum s : IsUseEnum.values()) {
						if (s.getName().equals(name) ) {
							return s;
						}
					}
					return null;
				}
				public int getIndex() {
					return this.index;
				}

				public String getName() {
					return this.name;
				}
			}
}
